int singleNumber(int nums[], int n)
{
    int i = 0;
    int single = 0;
    for (i = 0; i < n; i++)
    {
        single ^= nums[i];
    }
    return single;
}